<?php

/**
 * @author @author Samrat Khan & Sadik Sarfaraz - May 25, 2013
 */
require 'top.inc.php';
$formLoad = new Form();
if(isset($_SESSION['user']) && $_SESSION['user']['utype'] == 1) {
    
    if(isset($_POST['junkremoverBtn'])) {
        $junktbl = $_POST['junktbl'];
        $catch = explode('tbl_', $junktbl);
        junkRemover($catch[1], $db);        
    } else {
        $form.='<form action="" method="POST">
                    <select name="junktbl">
                        <option value="tbl_stockin">Stock In</option>
                        <option value="tbl_stockout">Stock Out</option>
                        <option value="tbl_returns">Faulty Return</option>
                        <option value="tbl_faulty_export">Faulty Export</option>
                    </select><br/>
                    <input class="btn btn-danger" type="submit" name="junkremoverBtn" value="Remove" />
                </form>';
        echo $form;
    }
} else {
    header("Location: login.php");
}
include ('bottom.inc.php');
?>
